package com.gitee.wsl.common.chart.sample.arc.legend

import com.gitee.wsl.common.chart.model.PlotDot
import com.gitee.wsl.common.chart.render.foreground.AbstractChartLegend
import com.gitee.wsl.common.chart.sample.XChart
import com.gitee.wsl.common.chart.sample.arc.model.ArcLineData
import com.gitee.wsl.common.ui.draw.type.DotStyle

class ArcLineLegend(mXChart: XChart) : AbstractChartLegend<ArcLineData>(mXChart) {
    override fun convertArrayKey(dataSet: List<ArcLineData>) {
        var key = ""
        for (cData in dataSet) {
            key = cData.key
            if (!isDrawKey(key)) continue
            if ("" === key) continue
            mLstKey.add(key)
            mLstColor.add(cData.color)
            val pDot = PlotDot()
            pDot.dotStyle = DotStyle.RECT
            mLstDotStyle.add(pDot)
        }
    }
}